package com.CRApp.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.springframework.validation.annotation.Validated;


import java.time.LocalDateTime;

/**
 * @ClassName: User
 * @Author : LuoFan洛樊
 * @Date : 2025/2/4 - 23:21
 * Description : 用户数据表
 */
@Data
public class User {
    @NotNull
    private Integer id;  //主键id
    private String username;//用户名
    private String nickname;//昵称
    @JsonIgnore //让json忽略该字段
    private String password;//用户密码
    private int gender;//性别
    @Pattern(regexp = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$")
    private String email;//邮箱
    private String userPic;//头像
    private LocalDateTime createTime;//注册时间
}
